<template>
	<view class="mine-container">
		<!-- 用户信息区域 -->
		<view class="user-info">
			<image class="avatar" src="/static/image/card/avatar.jpg"></image>
			<view class="user-detail">
				<view class="name-level">
					<text class="username">叫暴客6770779</text>
					<image src="/static/image/card/level.png"></image>
				</view>
				<text class="account-text" @click="goTo('/pages/mine/setting/setting')">账户设置</text>
			</view>
		</view>

		<!-- VIP会员按钮 -->
		<view class="vip-card">
			<image src="/static/image/mine/buy-background.png"></image>
			<view class="vip-btn" @click="buyCard">
				<view class="left">
					<text>一卡通VIP会员</text>
					<uni-icons type="right" size="12" color="#FBF6E5" style="margin-left: 15rpx;"></uni-icons>
				</view>
				<view class="buy-btn">立即购买</view>
			</view>
		</view>

		<!-- 菜单列表 -->
		<view class="menu-list">
			<view class="menu-item" @click="goTo('/subPackages/order/order')">
				<view class="left">
					<image src="/static/image/mine/icon-1.png" class="iconfont"></image>
					<text>我的订单</text>
				</view>
				<uni-icons type="right" size="20"></uni-icons>
			</view>
			<view class="menu-item" @click="goTo('/subPackages/balance/balance')">
				<view class="left">
					<image src="/static/image/mine/icon-2.png" class="iconfont"></image>
					<text>余额</text>
				</view>
				<uni-icons type="right" size="20"></uni-icons>
			</view>
			<view class="menu-item" @click="goTo('/subPackages/coupon/coupon')">
				<view class="left">
					<image src="/static/image/mine/icon-3.png" class="iconfont"></image>
					<text>优惠券</text>
				</view>
				<uni-icons type="right" size="20"></uni-icons>
			</view>
			<view class="menu-item" @click="goTo('/subPackages/setting/setting')">
				<view class="left">
					<image src="/static/image/mine/icon-4.png" class="iconfont"></image>
					<text>设置</text>
				</view>
				<uni-icons type="right" size="20"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {
					avatar: '',
					username: '叫暴客6770779'
				}
			}
		},
		methods: {
			// 购买一卡通
			buyCard() {
				uni.reLaunch({
					url:"/pages/tabbar/card/card"
				})
			},
			goTo(url) {
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style lang="scss">
	@import 'mine.scss'
</style>